The present disclosure relates to performance optimizations of computer programs in general, and to cache-related performance optimizations of computer programs in particular.
Performance of a computer program may be improved based on performance optimizations methods. Such methods include modifying the computer program, also referred to as a target program, to perform in a more efficient manner such as for example to be executed more rapidly, to require less resources such as memory space or draw less power. Although referred to as optimizing performance of the target program, such methods do not necessarily provide the best possible performance. In some cases, performing an optimization may unfortunately lead to a reduction in efficiency of the target program in some execution or even in all executions.
Some optimization methods target functionality associated with the cache of a computer executing the target program. For example, known optimization methods include automatic reordering of data object accessed within critical section and providing suggestions on changing the locks type based on the access patters in data within critical section. Reducing a number of cache misses during an execution may increase efficiency of the target program. Eviction of a value from the cache that is later used may also be avoided to increase efficiency.
In case the target program is a concurrent program, such as a multi-threaded program or a multi-process program, operation during critical sections of the target program may drastically affect performance. During a critical section one processing entity, generally referred to as a thread, may execute the critical section while another thread may halt until the execution of the critical section ends. Therefore, increasing speed of execution of a critical section may be a worthwhile optimization goal.